﻿<phone:PhoneApplicationPage 
    x:Class="wp7example.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:wp7example="clr-namespace:wp7example"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="DarkGreen" 
    SupportedOrientations="Portrait" Orientation="PortraitUp"
    shell:SystemTray.IsVisible="False" mc:Ignorable="d" d:DesignHeight="800" d:DesignWidth="480">
    <!-- this has a ugly layout-->
    <Grid x:Name="ContentPanel" Background="YellowGreen" Margin="-172,159,-160,149" Width="812" Height="492" RenderTransformOrigin="0.5,0.5" UseLayoutRounding="False" d:LayoutRounding="Auto">
        <Grid.RenderTransform>
            <CompositeTransform Rotation="90"/>
        </Grid.RenderTransform>
        <StackPanel Orientation="Horizontal">

            <Grid Margin="0">
                <Grid Width="640" Height="480" Margin="4,-6,0,0">
                    <!--Camera viewfinder-->
                    <Rectangle>
                        <Rectangle.Fill>
                            <VideoBrush x:Name="viewfinderBrush" x:FieldModifier="private"/>
                        </Rectangle.Fill>
                    </Rectangle>

                    <!--Overlay for the viewfinder region to display grayscale WriteableBitmap objects-->
                    <Image x:Name="overlayImage" x:FieldModifier="private" />
                </Grid>
                <Border Width="652" Height="492" Margin="-10,-12,-6,0" BorderThickness="10,10,5,10" BorderBrush="DarkGreen" CornerRadius="10"/>
                <StackPanel Margin="-127.25,151.75,0,166.75" RenderTransformOrigin="0.5,0.5" UseLayoutRounding="False" d:LayoutRounding="Auto" HorizontalAlignment="Left" Width="449">
                    <StackPanel.RenderTransform>
                        <CompositeTransform Rotation="-90"/>
                    </StackPanel.RenderTransform>
                    <TextBlock Height="30" HorizontalAlignment="Left" x:Name="txtTime" VerticalAlignment="Top"  FontSize="24" FontWeight="ExtraBold" TextWrapping="Wrap" x:FieldModifier="private" />
                    <TextBlock Height="30" HorizontalAlignment="Left" x:Name="txtPoints" VerticalAlignment="Top"  FontSize="24" FontWeight="ExtraBold" TextWrapping="Wrap" x:FieldModifier="private" />
                </StackPanel>
                <Border CornerRadius="10" BorderThickness="3" BorderBrush="#FF970D0D" HorizontalAlignment="Right" Margin="0,8,8,0" Width="57" Height="85" VerticalAlignment="Top" RenderTransformOrigin="0.5,0.5" Background="{StaticResource PhoneSemitransparentBrush}" />
                <Image Source="Resources\CloudOnline.png" x:Name="imgCloudOnline"  Width="48" Height="48" Margin="0,425,7,0" HorizontalAlignment="Right" VerticalAlignment="Top" d:LayoutOverrides="Width" RenderTransformOrigin="0.5,0.5" UseLayoutRounding="False" d:LayoutRounding="Auto"
                       x:FieldModifier="private" Visibility="Collapsed" />
                <Image Source="Resources\CloudTalking.png" x:Name="imgCloudTalking"  Width="48" Height="48" Margin="0,372,7,0" HorizontalAlignment="Right" VerticalAlignment="Top" d:LayoutOverrides="Width" RenderTransformOrigin="0.5,0.5" UseLayoutRounding="False" d:LayoutRounding="Auto"
                       x:FieldModifier="private" Visibility="Collapsed" IsHitTestVisible="False" />
                <Button ClickMode="Press" IsTabStop="False" Click="BtnLearnClick" Foreground="{x:Null}" Padding="0" Width="109" Height="98" Margin="0,1,-18,0" BorderBrush="{x:Null}" HorizontalAlignment="Right" VerticalAlignment="Top" d:LayoutOverrides="Width" RenderTransformOrigin="0.5,0.5" UseLayoutRounding="False" d:LayoutRounding="Auto">
                    <Button.Background>
                        <ImageBrush Stretch="UniformToFill" ImageSource="Resources\appbar.feature.camera.rest.png"/>
                    </Button.Background>
                    <Button.RenderTransform>
                        <CompositeTransform Rotation="-90"/>
                    </Button.RenderTransform>
                </Button>
                <Grid RenderTransformOrigin="0.5,0.5" Margin="80.5,44.5,163.5,47.5" UseLayoutRounding="False" d:LayoutRounding="Auto" Width="400" Height="300">
                    <Grid.RenderTransform>
                        <CompositeTransform Rotation="-90"/>
                    </Grid.RenderTransform>
                    <Border CornerRadius="10" BorderThickness="3" BorderBrush="White" Background="Blue" Opacity="0.5"  x:Name="ShowSave" x:FieldModifier="private" Visibility="Collapsed" >
                        <StackPanel VerticalAlignment="Center">
                            <TextBlock Text="Please enter the object name and ensure that it takes up the entire screen" TextWrapping="Wrap" FontSize="24" Foreground="White" HorizontalAlignment="Center" />
                            <StackPanel Orientation="Vertical">
                                <TextBox  Height="85" Width="250"  x:Name="ObjectName" Foreground="{StaticResource PhoneContrastForegroundBrush}" x:FieldModifier="private" Background="{StaticResource PhoneContrastBackgroundBrush}" BorderBrush="{x:Null}"/>
                                <Border CornerRadius="10" BorderThickness="3" BorderBrush="White" Width="360">
                                    <Button x:Name="btnSave" Content="Save" Click="BtnSaveClick" Foreground="White" x:FieldModifier="private" BorderBrush="{x:Null}" Width="360"/>
                                </Border>
                            </StackPanel>
                        </StackPanel>
                    </Border>
                </Grid>
            </Grid>

            <Grid Width="170" Margin="0">
                <Border Width="164" Height="492" Margin="-16,-12,-6,0" BorderThickness="5,10,10,10" BorderBrush="DarkGreen" CornerRadius="10"/>
                <TextBlock x:Name="txtStatus" Text="Starting...." FontSize="24" FontWeight="ExtraBold" d:LayoutRounding="Auto" x:FieldModifier="private" Height="67" Margin="13,0,-287,-39" UseLayoutRounding="False" VerticalAlignment="Bottom">
                	    <TextBlock.RenderTransform>
                		    <CompositeTransform Rotation="-90"/>
                	    </TextBlock.RenderTransform>
                </TextBlock>
                <TextBlock x:Name="txtOtherStatus" Text="Waiting to connect" FontSize="24" FontWeight="ExtraBold" UseLayoutRounding="False" Height="67" Margin="80,0,-287,-39"  VerticalAlignment="Bottom">
                    <TextBlock.RenderTransform>
                        <CompositeTransform Rotation="-90" />
                    </TextBlock.RenderTransform>
                </TextBlock>
            </Grid>
            
        </StackPanel>
        <Canvas HorizontalAlignment="Right" Height="482" Margin="0,-10,165,0" Background="DarkGreen" Width="5"/>        
    </Grid>

    <phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True" Mode="Minimized" Opacity="0.5">            
            <shell:ApplicationBar.MenuItems>
                <shell:ApplicationBarMenuItem Text="Purge local repositorys" Click="Purge"/>
            </shell:ApplicationBar.MenuItems>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>

</phone:PhoneApplicationPage>